import java.util.HashMap;
import java.util.Map;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.yunhe.spring.mybatis.model.Goods;
import com.yunhe.spring.mybatis.model.Pages;
import com.yunhe.spring.mybatis.service.IGoodsService;

@RunWith(SpringJUnit4ClassRunner.class)
//配置了@ContextConfiguration注解并使用该注解的locations属性指明spring和配置文件之后，
@ContextConfiguration(locations = {"classpath:spring/spring.xml", "classpath:spring/spring-mybatis.xml" })
public class godotest {
	@Autowired
	private IGoodsService userService;
@Test
public void get(){
	Map<String, Object> map=new HashMap<String ,Object>();
	map.put("pageSize", 5);
	map.put("curPageNum", 1);
	Goods goods=new Goods();
	goods.setGname("事");
	map.put("goods", goods);
	//map.put("goodname", "事");
	Pages pages=userService.getAllGoods(map);
	
	
	System.out.println(pages.toString());
}
}
